package com.eshop.domain;

import java.io.Serializable;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Sergey
 * Date: 25.10.13
 * Time: 20:32
 * To change this template use File | Settings | File Templates.
 */
public class Category implements Serializable {
    public static final int ROOT_CATEGORY = 0;

    private int id;
    private String name;
    private String description;
    private int parentId;

    private List<Category> subCategories;

    public Category() {
        parentId = ROOT_CATEGORY;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public int getParentId() {
        return parentId;
    }

    public void setParentId(int parentId) {
        this.parentId = parentId;
    }

    public List<Category> getSubCategories() {
        return subCategories;
    }

    public void setSubCategories(List<Category> subCategories) {
        this.subCategories = subCategories;
    }

    @Override
    public String toString() {
        return getName();
    }
}
